GET
/v1/payments/{id}

Retrieve Payment Status

Check if a payment succeeded, failed, or is pending. Use this endpoint to poll for payment status or verify payment completion.

Overview

Retrieve the current status and details of a payment by its ID. This endpoint is useful for checking payment status after creation or when webhook delivery fails.

Payment Statuses:

  • pending - Payment is being processed
  • succeeded - Payment completed successfully
  • failed - Payment was declined or failed
  • refunded - Payment has been refunded

Request

Path Parameters
id
required

The payment ID returned when creating the payment

Code Examples

curl -X GET "https://api.altafinex.com/v1/payments/pay_1234567890abcdef" \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  

Response

Status Codes

200
Payment retrieved successfully
401
Authentication failed
404
Payment not found
Success Response
Example response for a successful request
{
  "payment_id": "pay_1234567890abcdef",
  "status": "succeeded",
  "amount": 10000,
  "currency": "THB",
  "description": "Payment for order #12345",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:15Z",
  "card": {
    "last4": "1111",
    "brand": "visa"
  }
}
Error Response
Example response for an error
{
  "error": {
    "code": "payment_not_found",
    "message": "The payment with the specified ID was not found",
    "type": "not_found"
  }
}

Related Endpoints